import 'package:color_dart/HexColor.dart';
import 'package:color_dart/RgbaColor.dart';
import 'package:flutter/material.dart';
import 'package:im_flutter_sdk_example/components/a_button/index.dart';
import 'package:im_flutter_sdk_example/utils/global.dart';

class EmptyAlliance extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    double screenW = G.screenWidth();
    double screenH = G.screenHeight();

    return Stack(
      alignment: Alignment.center,
      children: [
        Container(
          height: G.screenHeight(),
          child: Container(
            height: G.screenHeight() * 0.3,
            width: screenW,
            decoration: BoxDecoration(
              gradient: LinearGradient(colors: [
                rgba(233, 242, 254, 1),
                Colors.white,
              ], begin: Alignment.topCenter, end: Alignment.bottomCenter),
            ),
          ),
        ),
        Positioned(
          left: 0,
          top: 200,
          child: Image.asset('lib/assets/images/alliance/empty_1.png',
              width: 65, height: 112),
        ),
        Positioned(
          right: 0,
          width: 150,
          top: 140,
          child: Image.asset('lib/assets/images/alliance/empty_2.png',
              width: 64, height: 100),
        ),
        Positioned(
            right: 0,
            bottom: 200,
            height: 102,
            child: Image.asset('lib/assets/images/alliance/empty_3.png')),
        Positioned(
          top: 60,
          child: Container(
            width: screenW * 0.9,
            child: Row(
              crossAxisAlignment: CrossAxisAlignment.center,
              mainAxisAlignment: MainAxisAlignment.spaceBetween,
              children: [
                Text('我的联盟',
                    style:
                        TextStyle(fontSize: 30, fontWeight: FontWeight.bold)),

                GestureDetector(
                  onTap: () => {G.pushNamed('/group_list')},
                  child: Text('加入',
                      style: TextStyle(
                        fontSize: 15,
                      )),
                )

                // Container(
                //     margin: EdgeInsets.only(top: 15),
                //     width: screenW * 0.9,
                //     height: 1,
                //     color: rgba(213, 219, 230, 0.86),
                //     child: Text('查找',
                //     style:
                //         TextStyle(fontSize: 30, fontWeight: FontWeight.bold)),),
              ],
            ),
          ),
        ),
        Positioned(
          top: screenH * 0.3,
          child: Image.asset(
            'lib/assets/images/alliance/empty_shield.png',
            height: 158,
            fit: BoxFit.cover,
          ),
        ),
        Positioned(
            top: screenH * 0.3 + 158,
            child: Text("您目前未加入小组",
                style: TextStyle(color: rgba(109, 120, 152, 1), fontSize: 17))),
        Positioned(
          top: screenH * 0.3 + 158 + 50,
          child: AButton.normal(
              width: screenW * 0.3,
              child: Text('创建小组'),
              borderRadius: BorderRadius.circular(44),
              color: hex('#fff'),
              bgColor: rgba(42, 125, 250, 1),
              borderColor: rgba(136, 175, 213, 1),
              onPressed: () => G.pushNamed('/alliance_create')),
        )
      ],
    );
  }
}
